/**
 * 
 */
package es.ubu.ceudaaj.exercise.interfaz;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.BorderLayout;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * 
 * @copirygth
 * @author Miguel
 * @version
 * 
 */
public class Inicio {

	private JFrame frmInicio;
	private JButton btnJAXB;
	private JButton btnDOM;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Inicio window = new Inicio();
					window.frmInicio.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Inicio() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmInicio = new JFrame();
		frmInicio.setTitle("Seleccione una opcion:");
		frmInicio.setBounds(100, 100, 450, 300);
		frmInicio.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frmInicio.getContentPane().setLayout(
				new FlowLayout(FlowLayout.CENTER, 5, 5));

		btnJAXB = new JButton("Agenda JAXB");

		btnJAXB.addMouseListener(new BtnJAXBMouseListener());
		frmInicio.getContentPane().add(btnJAXB);

		btnDOM = new JButton("Agenda DOM");
		btnDOM.setEnabled(false);
		frmInicio.getContentPane().add(btnDOM);
	}

	private class BtnJAXBMouseListener extends MouseAdapter {
		@Override
		public void mouseClicked(MouseEvent arg0) {
			MenuJAXB menuJAXB = new MenuJAXB();
			menuJAXB.setVisible(true);
		}
	}

}
